package org.activemonitoring.monitors.rest;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.apache.log4j.Logger;

@Path("ping")
public class TestRestResource {

    private static final Logger logger = Logger.getLogger(TestRestResource.class);

    @GET
    @Produces("text/plain")
    public String ping() throws Exception {
        logger.info("Ping service called");
        Thread.sleep(15L);
        return "pinged!";
    }

    @GET
    @Path("error")
    @Produces("text/plain")
    public String error() throws Exception {
        logger.info("Ping service called");
        throw new Exception("An error has occured");
    }
}
